#include <stdio.h>


int sum_array(int * a, int n)
{
    int i, sum;
    sum = 0;
    for (int i = 0; i < n; i++)
    {
        sum += a[i];
    }
    return sum;
}
int main()
{
    int a[] = {1, 2, 3, 4, 5, 6, 7, 8,9,10};

    printf("%d\n", sum_array(a, 10));//传数组名和数组大小
    return 0;
}